Skip to main content
Version: 2.0

User Consent

Enterprise can opt for 'User Consent'. All business-initiated conversations via Sinch India WhatsApp Business API should start with an “Opt-In/Opt-Out” by the user. This can be collected through any third-party channel. For example, in an SMS message, In-line with a Web Form, in an Email, or even via a deep-link in print media.

Enterprise can record an opt-in/opt-out by the API call as described below.

Opt-In:
WhatsApp suggests to obtain Opt-Ins from end-user before the business send them any notification and it need to be maintained in the DB which can be referred at any point later. The Opt-In can be collected from user using third party medium or within WhatsApp if a chat window is ongoing. Sinch India has defined an API to share Opt-In information about customers. Business can integrate their system with the API to share the Opt-In as in when acquired from customer (live opt-in services).

Real time Opt-In request flow:

  • End customer will provide his Opt-In request through the business Opt-In platform.
  • Request will be authenticated.
  • Request will get updated in the Sinch India's database in real-time and response will be received by the business.

Note: Business can also share the consent in an offline mode through excel files.

Acknowledgement with Optin: Business can also send a notification as welcome message with each entry in Opt-In table to end user on WhatsApp. This is a configurable feature which can be enabled on request and template need to be whitelisted in advance. We support sending static text/media message as acknowledgement with optin entry.

Request URL:

The request will be authorized using the token provided in the 'Header', generated as described in the Before You Start section.

JSON object parameters:

NameDescriptionJson TypeDefaultConstraintsRequired
msisdnListList of MSISDNsArray of stringN/A10,000 elementsYes

Sample:

{
"msisdnList": [
"91XXXXXXXXXX",
"91XXXXXXXXXX"
]
}

Request type: POST

Responses:
200 OK
Opt-In completed successfully.

400 Bad Request

There was an error with your request. The body is a JSON object described above in HTTP Errors.

401 Unauthorized

There was an authentication error with your request. Either you're using incorrect credentials or you're attempting to authenticate in a region where your bot doesn't reside. The body is a JSON object described above in HTTP Errors.

Opt-Out:
Request URL:

Request type: POST

The request will be authorized using the token provided in the 'Header', generated as described in the Before You Start section.

JSON object parameters:

NameDescriptionJson TypeDefaultConstraintsRequired
msisdnListList of MSISDNsArray of stringN/A10,000 elementsYes

Sample:

{
"msisdnList": [
"91XXXXXXXXXX",
"91XXXXXXXXXX"
]
}

Responses:
200 OK
Opt-out completed successfully.

400 Bad Request

There was an error with your request. The body is a JSON object described above in HTTP Errors.

401 Unauthorized

There was an authentication error with your request. Either you're using incorrect credentials or you're attempting to authenticate in a region where your bot doesn't reside. The body is a JSON object described above in HTTP Errors.

Fetch User Consent Data:
API Endpoint:

Request type: GET

The request will be authorized using the token provided in the 'Header' generated as described in the Before You Start section.

curl --location '
https://smartta.aclwhatsapp.com/optindata/v1/2024-05-29/2024-05-31/'\
--header 'Authorization: Bearer XXXXXXX' \
--data ''

Header values:

NameValue
AuthorizationBearer token

Parameters:

NameDescriptionRestrictionFormatValue
fromDateThe date from which opt-in data need to be fetched.Duration between fromDate and toDate should not be more than 10 days.YYYY-MM-DD2023-07-04
toDateThe date upto which opt-in data need to be fetched.Optional field.YYYY-MM-DD2023-07-04

Responses Payload:

[
{
"msisdn": "9188XXXXXXXX",
"createdOn": "2023-07-04T10:04:54.582Z",
"optInStatus": 1,
"source": "Keyword"
},
{
"msisdn": "9188XXXXXXXX",
"createdOn": "2023-07-04T10:54:22.427Z",
"optInStatus": 0,
"source": "Keyword"
}
]
KeyDescription
msisdnThe MSISDN of the User.
createdOnThe date record opted in or opted out.
optInStatusoptInStatus - 1 denotes to 'Consent Given', 0 denotes to 'Consent Revoked'.
sourceMechanism through which user opted in or opted out. Values - Keyword, API.

The response of the API will be synchronous.